<?php

/*
 * 这不是一个开放软件，您不能用于商业应用
 * 不允许对程序代码以任何形式任何目的的再发布。
 * Copyright (c) 2015 YOUM.Co.Ltd. All rights reserved..
 * 网站地址：http://www.huishuojs.com
 * Author Zhyu
 */

/**
 * @author Zhyu
 * @date 2016-01-29 06:03:51
 * @copyright 杭州晖硕有码科技
 */
class Money extends WX_Controller{
    //put your code here
    public function __construct() {
        parent::__construct();
        $this->load->model('money_log_model');
    }
    public function index(){
        $money_list=$this->money_log_model->getMoneyLogAll(array('user_id'=>$this->user['id']));
        foreach($money_list as $key => $value) {
            $type_name='';
            switch ($value['type']) {
                case 'direct':
                    $type_name='直推';
                    break;
                case 'concur':
                    $type_name='互助';
                    break;
                case 'range':
                    $type_name='极差';
                    break;
                case 'welfare':
                    $type_name='福利';
                    break;
                case 'tixian':
                    $type_name='提现';
                    break;
                case 'tax':
                    $type_name='税';
                    break;
                case 'feiyong':
                    $type_name='维护费';
                    break;
                case 'zhuan':
                    $type_name='转账';
                    break;
                case 'bonus' :
                    $type_name = '分红';
                    break;
                case 'guquan' :
                    $type_name = '股权';
                    break;
                default:
                    $type_name=$value['type'];
                    break;
            }
            $money_list[$key]['type_name'] =$type_name;
            $money_list[$key]['create_time'] = date("Y-m-d H:i:s",$value['create_time']);
				
        }
        $this->data['money']=$money_list;
        $this->load->view('/wap/log',$this->data);
    }
    public function system_log(){
        $this->load->model('system_money_rizhi_model');
        $money_list=$this->system_money_rizhi_model->getSystemMoneyRizhiAll(array('user_id'=>$this->user['id']));
        foreach($money_list as $key => $value) {
            $type_name='';
            switch ($value['type']) {
                case 'direct':
                    $type_name='直推';
                    break;
                case 'concur':
                    $type_name='互助';
                    break;
                case 'range':
                    $type_name='极差';
                    break;
                case 'welfare':
                    $type_name='福利';
                    break;
                case 'tixian':
                    $type_name='提现';
                    break;
                case 'tax':
                    $type_name='税';
                    break;
                case 'feiyong':
                    $type_name='维护费';
                    break;
                case 'zhuan':
                    $type_name='转账';
                    break;
                case 'bonus' :
                    $type_name = '分红';
                    break;
                case 'guquan' :
                    $type_name = '股权';
                    break;
                default:
                    $type_name=$value['type'];
                    break;
            }
            $money_list[$key]['type_name'] =$type_name;
            $money_list[$key]['create_time'] = date("Y-m-d H:i:s",$value['create_time']);
    
        }
        $this->data['money']=$money_list;
        $this->load->view('/wap/system_log',$this->data);
    }
}
